package com.example.myapplication.ui.activity.coins

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.example.myapplication.request.CoinsRequest
import kotlinx.coroutines.launch

/**
 *用户积分流水的viewModel
 *
 * @author : Kun
 * @date : 2021/6/11
 * @time : 13:24
 */
class UserCoinsViewModel : ViewModel() {
    /**
     * 用户积分流水
     */
    val coinsRequest = CoinsRequest()

    /**
     * 请求用户积分流水
     */
    fun requestCoinRecordList(index: Int){
        viewModelScope.launch {
            coinsRequest.requestCoinRecordList(index)
        }
    }
}